package com.cjh.controller;

import com.cjh.entity.Person;
import com.cjh.feign.FeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author cjh
 * @date 2021/3/26 17:25
 */
@RestController
@RequestMapping("/hystrix")
public class HystrixController {

    @Autowired
    private FeignClient feignClient;

    @GetMapping("/getPort")
    public String getPort(){

        return feignClient.getPort();
    }

    @GetMapping("/list")
    public List<Person> list(){

        return feignClient.list();
    }
}
